package com.my.attendance.service;

import com.my.attendance.dao.AttendanceDAO;
import com.my.attendance.entity.Attendance;
import com.my.attendance.entity.Employee;

import java.util.List;

public class AttendanceService {
    private AttendanceDAO dao = new AttendanceDAO();
    public List<Attendance> getAttendanceList() throws Exception {
        List<Attendance> list = dao.getAttendanceList();
        for (Attendance attendance : list) {
            Employee employee = dao.getEmployeeName(attendance.getEmployee_number());
            attendance.setEmployee(employee);
        }
        return list;
    }
}
